package com.kly.pay.task;

import com.fqgj.log.factory.LogFactory;
import com.fqgj.log.interfaces.Log;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;

/**
 * 支付回调任务
 * @author linqu
 */
@Component
public class PayCallBackTask {
    private static Log logger = LogFactory.getLog(PayCallBackTask.class);

    @Resource
    CallBackTaskService callBackTaskService;

    /**
     * 上一次执行结束之后30秒再执行（以支付回调为主，此任务只用于回调失败后的补偿机制）
     */
    @Scheduled(fixedDelay = 30000)
    public void execute() {
        logger.info("=============PayCallBackTask.execute Start==================");
        callBackTaskService.syncCallBack();
        logger.info("=================PayCallBackTask.execute End==============");
    }

}
